<template>
  <div id="app">
    <router-link to="/">Home</router-link>
    <router-view />
    <div @click="getData">get</div>
  </div>
</template>

<script>
// @ is an alias to /src
import axios from "axios";
const service = axios.create({
  baseURL: process.env.VUE_APP_LOGIN_URL, // 在请求中进行配置
  timeout: 10000,
});
console.log(process.env.VUE_APP_LOGIN_URL);
export default {
  name: "app",
  methods: {
    getData() {
      service
        .get("/students", {})
        .then(function (response) {
          console.log(response);
        })
        .catch(function (error) {
          console.log(error);
        });
    },
  },
};
</script>

<style lang="scss">
</style>
